<?php

class Jd_banner_model extends MY_Model {

    public function __construct()
    {
        $this->modelename='Jd_banner_model';
        $this->tablename='banner';
        parent::__construct();
    }


    /**
     * 获取列表
     */
    public function getlist(){
        $sql="select * from jd_banner where webid=  ".$this->web_id;
        $sql.=" order by `order`";
        return $this->GetBySql($sql);
    }


    public function delarticle($id){
        $row[]=$id;
        return  $this->delete($this->tablename,"id",$row);
    }


    /**
     *
     *
     * @param array $array
     * @return INT
     */
    public function  addpic($array=array()){
        $array['user_id']=$this->userId;
        $array['addtime']=time();

        return  $r= $this->add($this->tablename,$array);
    }

}
